public virtual void Draw(SpriteBatch spriteBatch)
{
- foreach (Actor child in Children)
+ Actor child = null;
+
+ // TODO: Check what's up with the null children.
+ if (Children == null)
{
+ return;
+ }
+ for (var i = Children.Count - 1; i >= 0; i--)
+ {
+ child = Children[i];
child.Draw(spriteBatch);
}
spriteBatch.Draw(Texture, Position, null, Color, Angle, Origin, 1f, SpriteEffects.None, 0f);
- spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
+ //spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
}
void CheckOutliers()
{
Dying = true;
}
+
+ public virtual void CleanUp()
+ {
+ Texture = null;
+ BoxTexture = null;
+ Children = null;
+ Texture = null;
+ }
}
}